/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lihle.designconceptsprinciples.question1.coreprinciples.model;

/**
 *
 * @author user
 */
public class Triangle extends Shape {
    
    private int base;
   private int height;
   
   // Constructor
   public Triangle(String color, int base, int height) {
      super(color);
      this.base = base;
      this.height = height;
   }
   
   @Override
   public String toString() {
      return "Triangle of base=" + base + " and height=" + height + ", subclass of " + super.toString();
   }
   
   @Override
   public double getArea() {
      return 0.5 *  base * height;
   }

}
